package com.ssd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ssd.entity.OrderDetailEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderDetailMapper extends BaseMapper<OrderDetailEntity> {

    /**
     * 查询某个订单中的所有商品skuId
     * @param orderId
     * @return
     */
    @Select("select sku_id from tb_order_details where order_id = #{orderId}")
    public List<Long> selectIdByOrderNo(@Param("orderId") Long orderId);

    /**
     * 查询订单内的所有商品信息
     * @param orderId
     * @return
     */
    @Select("select * from tb_order_details where order_id = #{orderId}")
    public List<OrderDetailEntity> selectByOrderId(@Param("orderId") Long orderId);
}
